package com.uphone.magicleafteacher.pro.adapter;

import android.support.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.uphone.magicleafteacher.R;
import com.uphone.magicleafteacher.util.CommonUtil;
import com.uphone.magicleafteacher.view.MyBaseViewHolder;
import com.uphone.magicleafteacher.vo.StartStudentBean;

public class StudentStartAdapter extends BaseQuickAdapter<StartStudentBean.StarStudentsBean, MyBaseViewHolder> {


    public StudentStartAdapter() {
        super(R.layout.layout_item_startstudent);
    }

    @Override
    protected void convert(@NonNull MyBaseViewHolder helper, StartStudentBean.StarStudentsBean item) {
        if (item.getGender() == 1) {
            helper.setImageDrawable(R.id.img_xing, mContext.getResources().getDrawable(R.drawable.ic_man));
        } else {
            helper.setImageDrawable(R.id.img_xing, mContext.getResources().getDrawable(R.drawable.ic_woman));
        }
        helper.setText(R.id.text_student_na, CommonUtil.getStr(item.getStudentName()));
        helper.setText(R.id.text_student_age, item.getAge() + "");
        helper.setText(R.id.text_appraise, CommonUtil.getStr(item.getStudentComment()));
        helper.setImageViewCircle(mContext, R.id.iv_head, CommonUtil.getImageUrl(item.getHeadPhoto()));
    }
}
